//
//  CollectionViewCell.m
//  BeautifulLockerRoom
//
//  Created by mac on 16/7/30.
//  Copyright © 2016年 Winny. All rights reserved.
//

#import "CollectionViewCell.h"

@implementation CollectionViewCell

-(UIImageView *)imgView
{
    if (!_imgView) {
        _imgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WINDOWWIDTH / 2 - 4, WINDOWWIDTH / 2 + WINDOWWIDTH / 4)];
        
    }
    return _imgView;
}

-(UIImageView *)tagView
{
    if (!_tagView) {
        _tagView = [[UIImageView alloc]initWithFrame:CGRectMake(WINDOWWIDTH / 2 - 34,0,30,30)];
        
    }
    return _tagView;
}

-(UILabel *)taobao_title
{
    if (!_taobao_title) {
        _taobao_title = [[UILabel alloc]initWithFrame:CGRectMake(0, WINDOWWIDTH / 2 + WINDOWWIDTH / 4, WINDOWWIDTH / 2 - 4, 40)];
        _taobao_title.numberOfLines = 0;
        _taobao_title.textAlignment = NSTextAlignmentLeft;
        _taobao_title.textColor = [UIColor grayColor];
        _taobao_title.font = [UIFont systemFontOfSize:16];
    }
    return _taobao_title;
}

-(UILabel *)taobao_price
{
    if (!_taobao_price) {
        _taobao_price = [[UILabel alloc]initWithFrame:CGRectMake(WINDOWWIDTH / 4, WINDOWWIDTH / 2 + WINDOWWIDTH / 4 +40, WINDOWWIDTH / 4 - 2, 20)];
        _taobao_price.textAlignment = NSTextAlignmentLeft;
        _taobao_price.textColor = [UIColor lightGrayColor];
        _taobao_price.font = [UIFont systemFontOfSize:14];
        
    }
    return _taobao_price;
}

-(UILabel *)taobao_promo_price
{
    if (!_taobao_promo_price) {
        _taobao_promo_price = [[UILabel alloc]initWithFrame:CGRectMake(5, WINDOWWIDTH / 2 + WINDOWWIDTH/4 + 40, WINDOWWIDTH / 4 - 2, 20)];
        _taobao_promo_price.textAlignment = NSTextAlignmentLeft;
        _taobao_promo_price.font = [UIFont systemFontOfSize:16];
        _taobao_promo_price.textColor = [UIColor redColor];
        NSLog(@"%@",NSStringFromCGRect(_taobao_promo_price.frame));
    }
    return _taobao_promo_price;
}
-(UILabel *)label
{
    if (!_label) {
        _label = [[UILabel alloc]init];
        
        _label.frame = CGRectMake(self.taobao_price.frame.origin.x, self.taobao_price.center.y,self.taobao_price.bounds.size.width - 38, 1);
        _label.backgroundColor = [UIColor lightGrayColor];
    }
    return _label;
}

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        [self InterfaceLoad];
    }
    return self;
}

-(void)InterfaceLoad
{
    [self.contentView addSubview:self.imgView];
    [self.contentView addSubview:self.tagView];
    [self.contentView addSubview:self.taobao_price];
    [self.contentView addSubview:self.taobao_promo_price];
    [self.contentView addSubview:self.taobao_title];
    [self.contentView addSubview:self.label];
    self.backgroundColor = [UIColor whiteColor];
}



@end
